package com.example.feign.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author 软工2104-李家强-2100770248
 * @since 2023-09-19
 */
@Data
@TableName("user")
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("读者ID")
    @TableId("user_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    @ApiModelProperty("用户名")
    @TableField("username")
    @NotBlank(message = "用户名或密码为空")
    private String username;

    @ApiModelProperty("密码")
    @TableField("password")
    @NotBlank(message = "用户名或密码为空")
    private String password;

    @ApiModelProperty("用户头像")
    @TableField("photo")
    private String photo;

    @ApiModelProperty("邮箱")
    @TableField("email")
    @Email
    private String email;

    @ApiModelProperty("注册日期")
    @TableField("registration_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime registrationDate;

    @ApiModelProperty("是否被封禁")
    @TableField("is_banned")
    private Boolean isBanned;

    @ApiModelProperty("类型: 0读者, 1作者, 2管理员")
    @TableField("type")
    private Integer type;

    @ApiModelProperty("书籍作品数目")
    @TableField("book_count")
    private Integer bookCount;

    @ApiModelProperty("关注别人的数目")
    @TableField("follow_count")
    private Integer followCount;

    @ApiModelProperty("关注别人的数目")
    @TableField("fans_count")
    private Integer fansCount;

}
